<?php 
session_start();
require_once("include/authen.php");
require_once("include/ui.php");
if (!(isset($_POST['type']))){
	echo "<script>window.location='receive.php'</script>";
} 
if ($_POST['type']=='d'){
	$title="HO Receive Product Detail";
	$colspan=9;
}else{
	$title="HO Receive Product Check";
	$colspan=9;
}
echo headerPage($title);
?>

<SCRIPT src="js/js_receive_d.js"></SCRIPT> 
 <script>
$(function() {
	
	$("#btnPrint").live('click',function(){
		$("#normal-screen").hide();
		$("#page-header").hide();
		 
		$(".toolbar-box").hide();
		$("#foolter_table").hide();
		$("#leftboder").hide();
		$("#rightboder").hide();
		window.print();
		
		$("#normal-screen").show();
		$("#page-header").show();

		$(".toolbar-box").show();
		$("#foolter_table").show();
		$("#leftboder").show();
		$("#rightboder").show();
	});	
});
</script>
<FORM name="Act" action="<?php echo $PHP_SELF?>" method="post"> 
<INPUT type=hidden value="<?php echo $_POST['reID']?>" id="val" name="val"> 
<INPUT type=hidden value="<?php echo $_POST['type']?>" id="mode" name="mode"> 
<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" id='leftboder' style='border-left:2px solid #facb0c;'>&nbsp;</td>
    <td width="1004" valign="top">
        <div class="content-box">
            <div Class="toolbar-box">   
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                 </div>
                 <div class="m">
                    <div class="toolbar">
                        <table class="toolbar">
                        <tr>
						<?php  if (($_POST['type']=='c') && ($_SESSION["permission"][$receiveScreen]['Edit']=='1')){  ?>
							<td><a href="javascript:void('0');" id="btnCheck">
								<span class="icon_check"></span>Check
								</a>
							</td>
						<?php  } ?>
                            <td><a href="javascript:void('0');" id="btnBack">
								<span class="icon_back"></span>Back
								</a>
							</td>
							<td>
								<a href="javascript:void('0');" title="Print" id="btnPrint">
								<span class="icon_Print"></span>Print
								</a>
							</td>
                        </tr>
                        </table>
                    </div>
                      <div class="header" style="background-image: url(images/receive_2.png);">
						<?php echo $title?>
                      </div>
                <div class="clr"></div>
                 </div>
                 <div class="b">
                    <div class="b">
                        <div class="b"></div>
                    </div>
                 </div>
            </div>
               <div id="element-box">
                <div class="t">
					<div class="t">
						<div class="t"></div>
					</div>
				</div>
                <div class="m">
				<fieldset  class="ui-widget ui-widget-content">
				<legend style="padding-left:5px;font-weight:normal;color:#666">Information</legend>	
                    <table width="100%" style="line-height:25px">
                        <tr>
                            <td width="25%" class="fontSearch" style="padding-left:20;font-weight:bold;"><label for="name">&nbsp;&nbsp;Receive Code : </label><span id="iCode" style="font-weight:normal;"></span></td>
							 <td width="40%" class="fontSearch" style="padding-left:20;font-weight:bold;">Supplier : <span id="iName" style="font-weight:normal;"></span></td>
							 <td width="35%" class="fontSearch" style="padding-left:20;font-weight:bold;">Created Date : <span id="iCreateDate" style="font-weight:normal;"></span></td>
						</tr>
                        <tr>
                            <td width="20%" class="fontSearch" style="padding-left:20;font-weight:bold;">&nbsp;&nbsp;Credit Terms :
								<span id="iTerm" style="font-weight:normal;"></span>
							</td>
							<td width="20%" colspan="2" class="fontSearch" style="padding-left:20;font-weight:bold;">Status : 
								<span id="iStatus" style="font-weight:bold;color:red"></span>
							</td>
						</tr>	
					<?php  if($_POST['type']=='d'){?>
                        <tr>
                           <td width="20%" class="fontSearch" style="padding-left:20;font-weight:bold;">&nbsp;&nbsp;Received Date : 
							<span id="iReDate" style="font-weight:normal;"></span>
						   </td>
							<td width="20%" class="fontSearch" style="padding-left:20;font-weight:bold;" >Received By : 
								<span id="iReBy" style="font-weight:normal;"></span>
							</td>
						</tr>	
					<?php }?>
                    </table>
				</fieldset>
				<p></P>
                    <table cellspacing="1" id="resultData" class=list>
                    <thead>
                       <tr>
								<th width="4%" >No.</th>
								<th style="display:none;">ID</th>		
								<th style="display:none;">ProID</th>									
								<th class="title" width="25%" >Product</th>
								<th  class="title" width="15%"  nowrap="nowrap">Category</th>
								<th  class="title" width="10%"  nowrap="nowrap">Type</th>
								<th  class="title" width="5%"  nowrap="nowrap">Unit</th>
								<th  class="title" width="10%"  nowrap="nowrap">Requested</th>
								<th  class="title" width="10%"  nowrap="nowrap">Received</th>
								<th  class="title" width="10%"  nowrap="nowrap">Price</th>
								<th  class="title" width="10%"  nowrap="nowrap">Total</th>
                      </tr>
                    </thead>
                   <tbody>
                   </tbody>
                   <tfoot>
                         <tr>
							<td colspan="<?php echo $colspan?>">
								 <div class="boxfooter">
								 <div class="totalpage">Rows : 
									<span id="rowCount">0</span>&nbsp;&nbsp;
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total :&nbsp;
									<span id="totalAmt" style="color:blue;font-weight:bold">0</span>
								 </div>
								 <div id="paging_button"> 
								 </div>
								 </div> 
							</td>
                         </tr>
                     </tfoot>
                    </table>
                  <div class="clr"></div>
                </div>
                 <div class="b"><div class="b"><div class="b"></div></div></div>
                 <div class="clr"></div>
                </div> <!-- elementbox-->
        </div>
    </td>
    <td width="10" id='rightboder' style="border-right:2px solid #facb0c;">&nbsp;</td>
  </tr>
</table>
 </FORM>
 <div id="dialog-modal" title="Information">
	<p style="font-size:12px;padding-top:15px;">
	<span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
		<b>Update receive product completed</b> .
	</p>
</div>
<?php 
echo footer();
?>